function models(DataType, db) {
    let model = db.define('user', {
        id: {
            type: DataType.INTEGER,
            allowNull: false,
            autoIncrement: true,
            primaryKey: true
        },
        username: {
            type: DataType.STRING,
            allowNull: false
        },
        password: {
            type: DataType.STRING,
            allowNull: false
        },
        phone: {
            type: DataType.BIGINT,
            allowNull: false
        },
        avatar: {
            type: DataType.STRING,
            allowNull: false
        },
        role_id: {
            type: DataType.INTEGER,
            allowNull: false
        }
    });

    model.belongsTo(db.Role, { foreignKey: 'role_id' });

    // model.sync({force: true});

    return model;
}

exports.models = models;
